import Link from "next/link";
import { useRouter } from 'next/router'


function Mylink(props) {
    // 编程式跳转要引入react的router，需要react组件才能使用
    const router = useRouter()
    return(
        <div>
            {/* link跳转 */}
            <Link href="/mypage/zhangsan">ZhangSan</Link> | 
            {/* 编程式跳转 */}
            <a onClick={()=>{router.push('/data01')}}> let&apos;s go</a>
        </div>
    )    
}

export default Mylink